﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml.Linq;
using MySql.Data.MySqlClient;

namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            using (MySqlConnection con = new MySqlConnection("server=localhost;user id=root;password=root;persist security info=True;database=minterchat"))
            {
                con.Open();
                DataSet dset = new DataSet();

                MySqlDataAdapter myadapter = new MySqlDataAdapter("select * from oldchathistory", con);
                myadapter.Fill(dset);                
                dataGridViewWithPaging1.DataBind(dset.Tables[0]);
            }

            //XDocument xd = XDocument.Parse(@"<Books><Book><BookName>LINQ in Action</BookName></Book><Book><BookName>C# in Action</BookName></Book></Books>");
            //dataGridViewWithPaging1.DataBind(xd);

        }
    }
}
